From: Florian Müllner Date: Fri, 20 Mar 2015 13:29:40 +0000 (+0100) Subject: loginDialog: Move long session-list menus to the side X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1427 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9934529a0b67ed1d1e8506b9e2af29609b20b7a6;p=gnome-shell.git loginDialog: Move long session-list menus to the side Currently the menu position below the button means that the menu can extend to roughly half the screen height before ending up partly off-screen. This is plenty of space for commonly installed sessions, but some users have a significantly higher number of sessions in the list. Move the menu to the side of the button in that case to maximize the vertical space the menu may take up. https://bugzilla.gnome.org/show_bug.cgi?id=734352 --- diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 8da1b5501..eed43d711 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -49,6 +49,7 @@ const _FADE_ANIMATION_TIME = 0.25; const _SCROLL_ANIMATION_TIME = 0.5; const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0; const _LOGO_ICON_HEIGHT = 48; +const _MAX_BOTTOM_MENU_ITEMS = 5; const UserListItem = new Lang.Class({ Name: 'UserListItem', @@ -283,7 +284,16 @@ const SessionMenuButton = new Lang.Class({ this.actor = new St.Bin({ child: this._button }); - this._menu = new PopupMenu.PopupMenu(this._button, 0, St.Side.TOP); + let side = St.Side.TOP; + let align = 0; + if (Gdm.get_session_ids().length > _MAX_BOTTOM_MENU_ITEMS) { + if (this.actor.text_direction == Clutter.TextDirection.RTL) + side = St.Side.RIGHT; + else + side = St.Side.LEFT; + align = 0.5; + } + this._menu = new PopupMenu.PopupMenu(this._button, align, side); Main.uiGroup.add_actor(this._menu.actor); this._menu.actor.hide();